function HexToSingle(t)
{
    t = t.replace(/\s+/g, "");
    if (t === "") {
        return "";
    }
    if (t == "00000000") {
        return "0";
    }
    if ((t.length > 8) || (isNaN(parseInt(t, 16)))) {
        return "Error";
    }
    if (t.length < 8) {
        t = FillString(t, "0", 8, true);
    }
    t = parseInt(t, 16).toString(2);
    t = FillString(t, "0", 32, true);
    var s = t.substring(0, 1);
    var e = t.substring(1, 9);
    var m = t.substring(9);
    e = parseInt(e, 2) - 127;
    m = "1" + m;
    if (e >= 0) {
        m = m.substr(0, e + 1) + "." + m.substring(e + 1);
    }
    else {
        m = "0." + FillString(m, "0", m.length - e - 1, true);
    }
    if (m.indexOf(".") == -1) {
        m = m + ".0";
    }
    var a = m.split(".");
    var mi = parseInt(a[0], 2);
    var mf = 0;
    for (var i = 0; i < a[1].length; i++) {
        mf += parseFloat(a[1].charAt(i)) * Math.pow(2, -(i + 1));
    }
    m = parseInt(mi) + parseFloat(mf);
    if (s == 1) {
        m = 0 - m;
    }
    return m;
}

function main() {


    var baseAddress = Module.findBaseAddress("libcocos2dlua.so")


    if (baseAddress!=null)
    // Interceptor.attach(baseAddress.add(0x00D70660) , {
    Interceptor.attach(baseAddress.add(0x0BD1B00) , {
        onEnter: function (args) {
          // Memory.writeFloat (ptr(args[0]).add(36),5.0)
          // console.log(HexToSingle(args[1]))

         // console.log(Memory.readFloat((args[1])))
         //     console.log(  (  args[1] )) //3C 2B 5F A0
         //   args[1] =ptr(0x55e7ac773C2B5FA0)
        }, onLeave: function (ret) {

            return ret
        }
    })



}


setInterval(function(){
    main()
}, 5000)




// frida -U --no-pause -f  com.tencent.dm -l hooklibc.js
// frida -U --no-pause -f  com.xingin.xhs -l hooklibc.js
// frida -U --no-pause -f  com.tencent.mm -l hooklibc.js
// frida -U --no-pause -f  com.ss.android.ugc.aweme -l hooklibc.js
// frida -U --no-pause -f  com.diyibo.snmj.aligames -l game_snmj_speed.js